/* eslint-disable */
import { getRoles, getRoleType, getMenu, addRole, editRole, delRole } from '@/api/roleApi'
const role = {
    namespaced: true,
    state: {
        roleItem: ''
    },
    getters: {},
    mutations: {},
    actions: {
        GetRoles({ state, commit, dispatch }, params) {
            return new Promise((resolve, reject) => {
                getRoles(params).then(res => {
                    resolve(res)
                })
            })
        },
        GetRoleType({ state, commit, dispatch }, params) {
            return new Promise((resolve, reject) => {
                getRoleType(params).then(res => {
                    resolve(res)
                })
            })
        },
        GetMenu({ state, commit, dispatch }, params) {
            return new Promise((resolve, reject) => {
                getMenu(params).then(res => {
                    resolve(res)
                })
            })
        },
        AddRole({ state, commit, dispatch }, params) {
            return new Promise((resolve, reject) => {
                addRole(params).then(res => {
                    resolve(res)
                })
            })
        },
        EditRole({ state, commit, dispatch }, params) {
            return new Promise((resolve, reject) => {
                editRole(params).then(res => {
                    resolve(res)
                })
            })
        },
        DelRole({ state, commit, dispatch }, params) {
            return new Promise((resolve, reject) => {
                delRole(params).then(res => {
                    resolve(res)
                })
            })
        }
    }
}
export default role